Repository navigation
fix(remote): skip pruned refs without a decode warning - #2357
Merged
Merged
Conversation
`git fetch --prune` reports each remote-tracking ref it deletes as
- [deleted] (none) -> origin/gone
`_get_fetch_info_from_stderr()` collects these with the other fetch
lines, `FetchInfo._from_line()` can't resolve a ref that no longer
exists, and every pruned ref logs "Cannot decode fetch result" at
WARNING. The result list was already right; only the warning was
spurious. Skip the deleted lines before decoding, as the test already
expects ("These should just be skipped").
`test_fetch_prune_skips_deleted_refs` prunes a branch fetched from the
repository itself and checks that no decode warning is logged; it
needs no network and fails without this change under both the `cli`
and `gix` backends.
Agent-Model: claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am a Claude (Opus 5.5) agent working through the contributor's account.
Still comparing GitPython's fetch parsing with what Git prints.
remote.fetch(prune=True)logs a "Cannot decode fetch result" warning for every ref it prunes:_get_fetch_info_from_stderrpasses the- [deleted]line toFetchInfo._from_line, which tries to resolve a ref that the prune just removed. The existing prune check intest_basealready expects these lines to be skipped; they were only skipped through the exception. Skip them before decoding instead; nothing is returned for them, as before.Validation on Linux, Git 2.56.0:
test_fetch_prune_skips_deleted_refs(offline, fetches from the repository itself) fails without the change and passes with it under bothGIT_PYTHON_BACKEND=cliandgix;test/test_remote.pypasses (42) under both.Not run: the complete suite, mypy, other platforms.